Integrand size = 23, antiderivative size = 246 \[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\frac {\sqrt {a+b} \cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{d}-\frac {\cot (c+d x) \sqrt {a+b \sec (c+d x)}}{d}+\frac {2 \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a}{a+b},\arcsin \left (\frac {\sqrt {a+b}}{\sqrt {a+b \sec (c+d x)}}\right ),\frac {a-b}{a+b}\right ) \sqrt {-\frac {b (1-\sec (c+d x))}{a+b \sec (c+d x)}} \sqrt {\frac {b (1+\sec (c+d x))}{a+b \sec (c+d x)}} (a+b \sec (c+d x))}{\sqrt {a+b} d} \]
[Out]
Time = 0.27 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3981, 3865, 3960, 3917} \[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\frac {\sqrt {a+b} \cot (c+d x) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (\sec (c+d x)+1)}{a-b}} \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right )}{d}+\frac {2 \cot (c+d x) \sqrt {-\frac {b (1-\sec (c+d x))}{a+b \sec (c+d x)}} \sqrt {\frac {b (\sec (c+d x)+1)}{a+b \sec (c+d x)}} (a+b \sec (c+d x)) \operatorname {EllipticPi}\left (\frac {a}{a+b},\arcsin \left (\frac {\sqrt {a+b}}{\sqrt {a+b \sec (c+d x)}}\right ),\frac {a-b}{a+b}\right )}{d \sqrt {a+b}}-\frac {\cot (c+d x) \sqrt {a+b \sec (c+d x)}}{d} \]
[In]
[Out]
Rule 3865
Rule 3917
Rule 3960
Rule 3981
Rubi steps \begin{align*} \text {integral}& = \int \left (-\sqrt {a+b \sec (c+d x)}+\csc ^2(c+d x) \sqrt {a+b \sec (c+d x)}\right ) \, dx \\ & = -\int \sqrt {a+b \sec (c+d x)} \, dx+\int \csc ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx \\ & = -\frac {\cot (c+d x) \sqrt {a+b \sec (c+d x)}}{d}+\frac {2 \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a}{a+b},\arcsin \left (\frac {\sqrt {a+b}}{\sqrt {a+b \sec (c+d x)}}\right ),\frac {a-b}{a+b}\right ) \sqrt {-\frac {b (1-\sec (c+d x))}{a+b \sec (c+d x)}} \sqrt {\frac {b (1+\sec (c+d x))}{a+b \sec (c+d x)}} (a+b \sec (c+d x))}{\sqrt {a+b} d}+\frac {1}{2} b \int \frac {\sec (c+d x)}{\sqrt {a+b \sec (c+d x)}} \, dx \\ & = \frac {\sqrt {a+b} \cot (c+d x) \operatorname {EllipticF}\left (\arcsin \left (\frac {\sqrt {a+b \sec (c+d x)}}{\sqrt {a+b}}\right ),\frac {a+b}{a-b}\right ) \sqrt {\frac {b (1-\sec (c+d x))}{a+b}} \sqrt {-\frac {b (1+\sec (c+d x))}{a-b}}}{d}-\frac {\cot (c+d x) \sqrt {a+b \sec (c+d x)}}{d}+\frac {2 \cot (c+d x) \operatorname {EllipticPi}\left (\frac {a}{a+b},\arcsin \left (\frac {\sqrt {a+b}}{\sqrt {a+b \sec (c+d x)}}\right ),\frac {a-b}{a+b}\right ) \sqrt {-\frac {b (1-\sec (c+d x))}{a+b \sec (c+d x)}} \sqrt {\frac {b (1+\sec (c+d x))}{a+b \sec (c+d x)}} (a+b \sec (c+d x))}{\sqrt {a+b} d} \\ \end{align*}
Time = 3.61 (sec) , antiderivative size = 154, normalized size of antiderivative = 0.63 \[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\frac {\sqrt {a+b \sec (c+d x)} \left (-\cot (c+d x)-\frac {2 \cos ^2\left (\frac {1}{2} (c+d x)\right ) \left ((-2 a+b) \operatorname {EllipticF}\left (\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ),\frac {a-b}{a+b}\right )+4 a \operatorname {EllipticPi}\left (-1,\arcsin \left (\tan \left (\frac {1}{2} (c+d x)\right )\right ),\frac {a-b}{a+b}\right )\right ) \sqrt {\frac {1}{1+\sec (c+d x)}} \sqrt {\frac {a+b \sec (c+d x)}{(a+b) (1+\sec (c+d x))}}}{b+a \cos (c+d x)}\right )}{d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(545\) vs. \(2(226)=452\).
Time = 5.81 (sec) , antiderivative size = 546, normalized size of antiderivative = 2.22
method | result | size |
default | \(\frac {\sqrt {a +b \sec \left (d x +c \right )}\, \left (4 \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \operatorname {EllipticPi}\left (\cot \left (d x +c \right )-\csc \left (d x +c \right ), -1, \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (a +b \right ) \left (\cos \left (d x +c \right )+1\right )}}\, a \cos \left (d x +c \right )-2 \operatorname {EllipticF}\left (\cot \left (d x +c \right )-\csc \left (d x +c \right ), \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (a +b \right ) \left (\cos \left (d x +c \right )+1\right )}}\, a \cos \left (d x +c \right )+\operatorname {EllipticF}\left (\cot \left (d x +c \right )-\csc \left (d x +c \right ), \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (a +b \right ) \left (\cos \left (d x +c \right )+1\right )}}\, b \cos \left (d x +c \right )+4 \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (a +b \right ) \left (\cos \left (d x +c \right )+1\right )}}\, \operatorname {EllipticPi}\left (\cot \left (d x +c \right )-\csc \left (d x +c \right ), -1, \sqrt {\frac {a -b}{a +b}}\right ) a -2 \operatorname {EllipticF}\left (\cot \left (d x +c \right )-\csc \left (d x +c \right ), \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (a +b \right ) \left (\cos \left (d x +c \right )+1\right )}}\, a +\operatorname {EllipticF}\left (\cot \left (d x +c \right )-\csc \left (d x +c \right ), \sqrt {\frac {a -b}{a +b}}\right ) \sqrt {\frac {\cos \left (d x +c \right )}{\cos \left (d x +c \right )+1}}\, \sqrt {\frac {b +a \cos \left (d x +c \right )}{\left (a +b \right ) \left (\cos \left (d x +c \right )+1\right )}}\, b -a \cos \left (d x +c \right ) \cot \left (d x +c \right )-\cot \left (d x +c \right ) b \right )}{d \left (b +a \cos \left (d x +c \right )\right )}\) | \(546\) |
[In]
[Out]
\[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\int { \sqrt {b \sec \left (d x + c\right ) + a} \cot \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\int \sqrt {a + b \sec {\left (c + d x \right )}} \cot ^{2}{\left (c + d x \right )}\, dx \]
[In]
[Out]
\[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\int { \sqrt {b \sec \left (d x + c\right ) + a} \cot \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
\[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\int { \sqrt {b \sec \left (d x + c\right ) + a} \cot \left (d x + c\right )^{2} \,d x } \]
[In]
[Out]
Timed out. \[ \int \cot ^2(c+d x) \sqrt {a+b \sec (c+d x)} \, dx=\int {\mathrm {cot}\left (c+d\,x\right )}^2\,\sqrt {a+\frac {b}{\cos \left (c+d\,x\right )}} \,d x \]
[In]
[Out]